<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php 
	require_once DOC_ROOT."lib/connection.php";
	$id=$_GET['id'];
	$sql="SELECT * from users where user_id=?";
	$stmt = sqlsrv_query($con,$sql,array($id));
	if($stmt==false)
	{
		print_r(sqlsrv_errors());
		die();
	}
	if(sqlsrv_fetch($stmt)){
		$fname = sqlsrv_get_field($stmt,1);
		$lname=sqlsrv_get_field($stmt,2);
		$email = sqlsrv_get_field($stmt,3);
		$name = sqlsrv_get_field($stmt,4);
		$pass=sqlsrv_get_field($stmt,5);	
	}
?>
<form action="<?=ADMIN_URL?>post/doUser.php?action=edit">
	<table>
    	<tr>
        	<td>ID</td>
            <td>
            	<input type="hidden" value="edit" name="action" />
            	<input type="text" name="id" value="<?=$id?>" />
             </td>
        </tr>
        <tr>
        	<td>First_Name</td>
            <td><input type="text" name="txtfname" value="<?=$fname?>"/></td>
        </tr>
        <tr>
        	<td>Last_name</td>
            <td><input type="text" name="txtlname" value="<?=$lname?>" /></td>
        </tr>
        <tr>
        	<td>Email</td>
            <td><input type="text" name="email" value="<?=$email?>"/></td>
        </tr>
        <tr>
        	<td>Username</td>
            <td><input type="text" name="txtuser" value="<?=$name?>"/></td>
        </tr>
        <tr>
        	<td>Password</td>
            <td><input type="password" name="txtpass" value="<?=$pass?>"/></td>
        </tr>
        <tr>
        	<td>&nbsp;</td>
            <td><input type="submit" value="Save" /></td>
        </tr>
    </table>
</form>

</body>
</html>